home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-11 | 9.8 KB | 483 lines | [TEXT/MPS ] |
- ;
- ; File: Components.a
- ;
- ; Copyright: © 1984-1994 by Apple Computer, Inc.
- ; All rights reserved.
- ;
- ; Version: Universal Interfaces 2.0a3 ETO #16, MPW prerelease. Friday, November 11, 1994.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
-
- IF &TYPE('__COMPONENTS__') = 'UNDEFINED' THEN
- __COMPONENTS__ SET 1
-
-
- IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
- include 'Types.a'
- ENDIF
- ; include 'ConditionalMacros.a' ;
-
- IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
- include 'MixedMode.a'
- ENDIF
-
- kAppleManufacturer EQU 'appl' ; Apple supplied components
- kComponentResourceType EQU 'thng'
-
- kAnyComponentType EQU 0
- kAnyComponentSubType EQU 0
- kAnyComponentManufacturer EQU 0
- kAnyComponentFlagsMask EQU 0
-
- cmpWantsRegisterMessage EQU 1 << 31
-
- kComponentOpenSelect EQU -1 ; ComponentInstance for this open
- kComponentCloseSelect EQU -2 ; ComponentInstance for this close
- kComponentCanDoSelect EQU -3 ; selector # being queried
- kComponentVersionSelect EQU -4 ; no params
- kComponentRegisterSelect EQU -5 ; no params
- kComponentTargetSelect EQU -6 ; ComponentInstance for top of call chain
- kComponentUnregisterSelect EQU -7 ; no params
-
- ; Component Resource Extension flags
- componentDoAutoVersion EQU (1 << 0)
- componentWantsUnregister EQU (1 << 1)
- componentAutoVersionIncludeFlags EQU (1 << 2)
- componentHasMultiplePlatforms EQU (1 << 3)
-
- ; Set Default Component flags
- defaultComponentIdentical EQU 0
- defaultComponentAnyFlags EQU 1
- defaultComponentAnyManufacturer EQU 2
- defaultComponentAnySubType EQU 4
- defaultComponentAnyFlagsAnyManufacturer EQU (defaultComponentAnyFlags + defaultComponentAnyManufacturer)
- defaultComponentAnyFlagsAnyManufacturerAnySubType EQU (defaultComponentAnyFlags + defaultComponentAnyManufacturer + defaultComponentAnySubType)
-
- ; RegisterComponentResource flags
- registerComponentGlobal EQU 1
- registerComponentNoDuplicates EQU 2
- registerComponentAfterExisting EQU 4
-
- ComponentDescription RECORD 0
- componentType ds.l 1 ; A unique 4-byte code indentifying the command set
- componentSubType ds.l 1 ; Particular flavor of this instance
- componentManufacturer ds.l 1 ; Vendor indentification
- componentFlags ds.l 1 ; 8 each for Component,Type,SubType,Manuf/revision
- componentFlagsMask ds.l 1 ; Mask for specifying which flags to consider in search, zero during registration
- sizeof EQU 20
- ENDR
-
- ResourceSpec RECORD 0
- resType ds.l 1 ; 4-byte code
- resID ds.w 1
- sizeof EQU 6
- ENDR
-
- ComponentResource RECORD 0
- cd ds ComponentDescription ; Registration parameters
- component ds ResourceSpec ; resource where Component code is found
- componentName ds ResourceSpec ; name string resource
- componentInfo ds ResourceSpec ; info string resource
- componentIcon ds ResourceSpec ; icon resource
- sizeof EQU 44
- ENDR
-
- ComponentPlatformInfo RECORD 0
- componentFlags ds.l 1 ; flags of Component
- component ds ResourceSpec ; resource where Component code is found
- platformType ds.w 1 ; gestaltSysArchitecture result
- sizeof EQU 12
- ENDR
-
- ComponentResourceExtension RECORD 0
- componentVersion ds.l 1 ; version of Component
- componentRegisterFlags ds.l 1 ; flags for registration
- componentIconFamily ds.w 1 ; resource id of Icon Family
- sizeof EQU 10
- ENDR
-
- ComponentPlatformInfoArray RECORD 0
- count ds.l 1
- platformArray ds ComponentPlatformInfo
- sizeof EQU 16
- ENDR
-
- ExtComponentResource RECORD 0
- cd ds ComponentDescription ; registration parameters
- component ds ResourceSpec ; resource where Component code is found
- componentName ds ResourceSpec ; name string resource
- componentInfo ds ResourceSpec ; info string resource
- componentIcon ds ResourceSpec ; icon resource
- componentVersion ds.l 1 ; version of Component
- componentRegisterFlags ds.l 1 ; flags for registration
- componentIconFamily ds.w 1 ; resource id of Icon Family
- count ds.l 1 ; elements in platformArray
- platformArray ds ComponentPlatformInfo
- sizeof EQU 70
- ENDR
-
- ComponentParameters RECORD 0
- flags ds.b 1 ; call modifiers: sync/async, deferred, immed, etc
- paramSize ds.b 1 ; size in bytes of actual parameters passed to this call
- what ds.w 1 ; routine selector, negative for Component management calls
- params ds.l 1 ; actual parameters for the indicated routine
- sizeof EQU 8
- ENDR
-
- ComponentRecord RECORD 0
- data ds.l 1
- sizeof EQU 4
- ENDR
-
- ComponentInstanceRecord RECORD 0
- data ds.l 1
- sizeof EQU 4
- ENDR
-
- ;
- ; The parameter list for each ComponentFunction is unique. It is
- ; therefore up to users to create the appropriate procInfo for their
- ; own ComponentFunctions where necessary.
- ;
- IF GENERATING68K THEN
- Macro
- _RegisterComponent
- moveq #1,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT RegisterComponent
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _RegisterComponentResource
- moveq #18,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT RegisterComponentResource
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _UnregisterComponent
- moveq #2,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT UnregisterComponent
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _FindNextComponent
- moveq #4,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT FindNextComponent
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CountComponents
- moveq #3,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT CountComponents
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _GetComponentInfo
- moveq #5,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT GetComponentInfo
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _GetComponentListModSeed
- moveq #6,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT GetComponentListModSeed
- ENDIF
-
- ; Component Instance Allocation and dispatch routines
- IF GENERATING68K THEN
- Macro
- _OpenComponent
- moveq #7,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT OpenComponent
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CloseComponent
- moveq #8,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT CloseComponent
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _GetComponentInstanceError
- moveq #10,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT GetComponentInstanceError
- ENDIF
-
- ; Direct calls to the Components
- IF GENERATING68K THEN
- Macro
- _ComponentFunctionImplemented
- dc.w $2F3C
- dc.w $0002
- dc.w $FFFD
- moveq #0,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT ComponentFunctionImplemented
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _GetComponentVersion
- dc.w $2F3C
- dc.w $0000
- dc.w $FFFC
- moveq #0,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT GetComponentVersion
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _ComponentSetTarget
- dc.w $2F3C
- dc.w $0004
- dc.w $FFFA
- moveq #0,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT ComponentSetTarget
- ENDIF
-
- ; Component Management routines
- IF GENERATING68K THEN
- Macro
- _SetComponentInstanceError
- moveq #11,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT SetComponentInstanceError
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _GetComponentRefcon
- moveq #16,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT GetComponentRefcon
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SetComponentRefcon
- moveq #17,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT SetComponentRefcon
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _OpenComponentResFile
- moveq #21,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT OpenComponentResFile
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CloseComponentResFile
- moveq #24,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT CloseComponentResFile
- ENDIF
-
- ; Component Instance Management routines
- IF GENERATING68K THEN
- Macro
- _GetComponentInstanceStorage
- moveq #12,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT GetComponentInstanceStorage
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SetComponentInstanceStorage
- moveq #13,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT SetComponentInstanceStorage
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _GetComponentInstanceA5
- moveq #14,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT GetComponentInstanceA5
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SetComponentInstanceA5
- moveq #15,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT SetComponentInstanceA5
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CountComponentInstances
- moveq #19,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT CountComponentInstances
- ENDIF
-
- ; Useful helper routines for convenient method dispatching
- IF GENERATING68K THEN
- Macro
- _CallComponentFunction
- dc.w $70FF
- dc.w $A82A
- EndM
- ELSE
- IMPORT CallComponentFunction
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CallComponentFunctionWithStorage
- dc.w $70FF
- dc.w $A82A
- EndM
- ELSE
- IMPORT CallComponentFunctionWithStorage
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _DelegateComponentCall
- moveq #36,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT DelegateComponentCall
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _SetDefaultComponent
- moveq #30,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT SetDefaultComponent
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _OpenDefaultComponent
- moveq #33,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT OpenDefaultComponent
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _CaptureComponent
- moveq #28,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT CaptureComponent
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _UncaptureComponent
- moveq #29,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT UncaptureComponent
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _RegisterComponentResourceFile
- moveq #20,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT RegisterComponentResourceFile
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _GetComponentIconSuite
- moveq #41,d0
- dc.w $A82A
- EndM
- ELSE
- IMPORT GetComponentIconSuite
- ENDIF
-
- ENDIF ; __COMPONENTS__
-